#ifndef CAMERATHREAD_H
#define CAMERATHREAD_H
#include <QImage>
#include <QThread>



extern "C" {
#include <libavdevice/avdevice.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
}


class cameraThread : public QThread
{
    Q_OBJECT
public:
    cameraThread(AVFormatContext *fmt_ctx);
    void run() override;

    QImage convertYUVtoRGB1(AVFrame* frame);
    AVFormatContext *fmt_ctx;
    int video_stream_idx = -1;


signals:
    void newFrame(QImage);
};

#endif // CAMERATHREAD_H
